package fu.capstone.hanoicityguide.business.bo.food;

import java.util.ArrayList;

import android.content.Context;
import fu.capstone.hanoicityguide.business.model.Food;
import fu.capstone.hanoicityguide.dataaccess.food.FoodDAO;
import fu.capstone.hanoicityguide.dataaccess.food.FoodDAOImp;

public class FoodBOImp implements FoodBO {

	private Context context;
	private FoodDAO dao;

	public void setContext(Context context) {
		this.context = context;
	}

	public FoodBOImp() {

	}

	public FoodBOImp(Context ctx) {
		this.context = ctx;
		dao = new FoodDAOImp(context);
	}

	@Override
	public ArrayList<Food> listFood(String sorter) {
		// TODO Auto-generated method stub

		ArrayList<Food> arrFood = dao.listFood(sorter);
		return arrFood;
	}

	@Override
	public ArrayList<Food> searchFood(String keyword, String sorter) {
		// return food from DAO object
		return dao.searchFood(keyword, sorter);
	}

	@Override
	public Food browseFood(int foodID) {
		// TODO Auto-generated method stub
		Food food = dao.browseFood(foodID);
		return food;
	}
}
